<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
	'id'=>'bongkar-muat-form',
	'enableAjaxValidation'=>false,
)); ?>
<?php echo $form->errorSummary($model); ?>
        <?php   
            $statusMobil = ($model->statusMobil == 'Bongkar') ? 'Bahan Baku' : 'Bahan Jadi';
            $dataGudang = Gudang::model()->findAllByAttributes(array('kategori' => $statusMobil,'status' => 0), array('order' => 'gate ASC'));
	?>
<?php if(!empty($dataGudang)){ ?>
<p class="help-block">Fields with <span class="required">*</span> are required.</p>
<?php 
                        echo $form->textFieldRow($kartu, 'noTiket',array('class'=>'span5', 'disabled'=>'disabled'));
                        echo $form->textFieldRow($model, 'statusMobil',array('class'=>'span5', 'disabled'=>'disabled'));
                        $listGudang = CHtml::listData($dataGudang,'id', 'gate');
                        echo $form->select2Row($model, 'ref_gudang_id', array(
                               'data' => $listGudang,

                            ));
?>
<div class="form-actions">
	<?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType'=>'submit',
			'type'=>'primary',
			'label'=>$model->isNewRecord ? 'Create' : 'Save',
		)); ?>
</div>
<?php } else { ?>
<span class="alert alert-danger" role="alert"><strong>Maaf!</strong>&nbsp;Semua gudang <?=$statusMobil?> sudah terisi.</span>
<?php }?>
<?php $this->endWidget(); ?>
